import request from '@/config/axios'

// 资讯与房屋关联信息 VO
export interface InfoHouseVO {
  id: number // 资讯分类ID
  infoId: number // 资讯ID
  houseId: number // 房屋ID
  type: boolean // 房屋类型（0公寓 1现房）
}

// 资讯与房屋关联信息 API
export const InfoHouseApi = {
  // 查询资讯与房屋关联信息分页
  getInfoHousePage: async (params: any) => {
    return await request.get({ url: `/business/info-house/page`, params })
  },

  // 查询资讯与房屋关联信息详情
  getInfoHouse: async (id: number) => {
    return await request.get({ url: `/business/info-house/get?id=` + id })
  },

  // 新增资讯与房屋关联信息
  createInfoHouse: async (data: InfoHouseVO) => {
    return await request.post({ url: `/business/info-house/create`, data })
  },

  // 修改资讯与房屋关联信息
  updateInfoHouse: async (data: InfoHouseVO) => {
    return await request.put({ url: `/business/info-house/update`, data })
  },

  // 删除资讯与房屋关联信息
  deleteInfoHouse: async (id: number) => {
    return await request.delete({ url: `/business/info-house/delete?id=` + id })
  },

  // 导出资讯与房屋关联信息 Excel
  exportInfoHouse: async (params) => {
    return await request.download({ url: `/business/info-house/export-excel`, params })
  },
}